package com.example.workbench.common.emus;

import cn.hutool.core.util.PinyinUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum SuccessReturnCode implements BaseEnum {
    NORMAL(200,"success"),
    LOGIN_OUT(300,"用户登出成功"),
    CHANGE_PASSWORD(301,"密码修改成功");

    private Integer code;

    private String desc;

    @Override
    public Integer getNumber() {
        return getCode();
    }

    @Override
    public String getName() {
        return getDesc();
    }

    @Override
    public String getSimplePinYin() {
        return PinyinUtil.getAllFirstLetter(getDesc());
    }

    @Override
    public String getFullPinYin() {
        return PinyinUtil.getPinYin(getDesc());
    }
}
